<% layout('layout') -%><!--加载全局布局文件-->
<style>
    .ng-cloak{
        display: none;
    }
    body{
        background-color: #ffffff !important;
    }
    .am-list-thumb{
        max-height: none !important;
    }
    .am-border-right-0{
        border-right: none !important;
    }
    .am-input-group-label{
        font-weight: bold;
    }
    .sanchuxian{ text-decoration:line-through}
</style>
<!--NgC div start--->
<div ng-controller="CartAngularCtrl" ng-cloak class="ng-cloak">
    <!---尚无商品展示层-->
    <div id="remindDiv" ng-show="showRemindDiv">

        <div class="am-padding-sm" style="background-color: #FF7F00;color: #fff;" ng-show="showActivityDiv">
            <p ng-repeat="rule in ActivityRuleMJArray" class="am-padding-0 am-margin-0 am-text-default animated bounceIn" ng-class="{'am-text-lg':rule.checked}">
                <a class="am-badge am-badge am-radius " ng-class="{'am-badge-warning':rule.checked}">满减活动</a>
               <span ng-bind="rule.name"></span>  <span  ng-if='rule.checked==true' class="am-icon-check am-warning"></span>
            </p>
            <p ng-repeat="rule in ActivityRuleMSArray" class="am-padding-0 am-margin-0 am-text-default animated bounceIn" ng-class="{'am-text-lg':rule.checked}">
                <a class="am-badge am-badge am-radius " ng-class="{'am-badge-warning':rule.checked}">{{rule.title}}</a>
                <span ng-bind="rule.name"></span> <span  ng-if='rule.checked==true' class="am-icon-check am-warning"></span>
            </p>
        </div>
        <div class="am-text-center am-margin-lg">
            <a href="" class="am-icon-btn am-warning am-icon-warning"></a>
            <br/>
            您的购物车内还没有任何商品！
        </div>
        <div class="am-g">
            <div class="am-u-sm-6  am-text-center"><a href="/user/center" class="am-btn  am-radius am-btn-block  am-btn-warning">个人中心</a></div>
            <div class="am-u-sm-6  am-text-center"><a href="/classify" class="am-btn   am-radius am-btn-block am-btn-warning">立即逛逛</a></div>
        </div>
    </div>


    <!--购物车显示-->
    <div id="cartDiv"  ng-show="showCartDiv">
        <div class="am-padding-sm" style="background-color: #FF7F00;color: #fff;" ng-show="showActivityDiv">
            <p ng-repeat="rule in ActivityRuleMJArray" class="am-padding-0 am-margin-0 am-text-default animated bounceIn" ng-class="{'am-text-lg':rule.checked}">
                <a class="am-badge am-badge am-radius " ng-class="{'am-badge-success':rule.checked}">满减活动</a>
                <span ng-bind="rule.name"></span> <span  ng-if='rule.checked==true' class="am-icon-check am-warning"></span>
            </p>

            <p ng-repeat="rule in ActivityRuleMSArray" class="am-padding-0 am-margin-0 am-text-default animated bounceIn" ng-class="{'am-text-lg':rule.checked}">
                <a class="am-badge am-badge am-radius " ng-class="{'am-badge-success':rule.checked}">{{rule.title}}</a>
                <span ng-bind="rule.name"></span> <span  ng-if='rule.checked==true' class="am-icon-check am-warning"></span>
            </p>


        </div>

        <hr data-am-widget="divider" style="" class="am-divider am-divider-dotted am-margin-0" />

        <!--商品显示-->
        <div data-am-widget="list_news" class="am-list-news am-list-news-default" >
            <!--列表标题-->
            <div class="am-list-news-hd am-cf">
                <!--带更多链接-->
                <a href="###" class="">
                    <h2>购物清单</h2>
                    <span class="am-list-news-more am-fr pushgou am-hide">加价购 &raquo;</span>
                </a>
            </div>

            <div class="am-list-news-bd">
                <ul class="am-list">
                    <!--缩略图在标题左边 AG数据-->
                    <li ng-repeat="product in CartProductArray" class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left">
                        <div class="am-u-sm-1 am-list-thumb">
                            <input type="checkbox" value="None" ng-model="product.checked" ng-disabled="product.mold==2" ng-click="CheckBtn($index,product)"/>
                        </div>
                        <div class="am-u-sm-4 am-list-thumb">
                            <!----/detail/{{product.pid}}--->
                            <a href="#" class="">
                                <img ng-src="{{product.img}}" class="am-radius"/>
                            </a>
                            <div style="position: absolute;top: 0px;"><span ng-if='product.mold==1' class="am-badge am-badge-success">加价购</span></div>
                            <div style="position: absolute;top: 0px;"><span ng-if='product.mold==2 || product.mold==3' class="am-badge am-badge-danger">赠送品</span></div>
                        </div>
                        <div class=" am-u-sm-7 am-list-main">
                            <!--标题-->
                            <p class="am-list-item-hd am-padding-0 am-margin-0 am-text-sm" style="line-height: 12pt;"><span ng-bind="product.name"></span> <span ng-bind="product.specname"></span></p>
                            <!--数量和价格-->
                            <div class="">
                                <span class="am-text-danger"  ng-class="{'sanchuxian':product.mold==2}"><b>￥<span ng-bind="product.price"></span></b></span>
                                <div ng-if='product.inventory<20 && product.mold!=2' class="am-text-sm am-text-danger">剩余{{product.inventory}}件</div>
                                <div class="am-g">
                                    <div class="am-u-sm-12 am-padding-0 am-margin-0">
                                        <!--数量加减-->
                                        <div class="am-input-group" ng-if='product.mold!=2 && product.mold!=3 '>
                                            <span class="am-input-group-label am-radius" ng-click="TrashBtn($index,product)"><span class="am-icon-trash"></span></span>
                                            <span class="am-input-group-label am-border-right-0" ng-click="MinusBtn($index,product)">-</span>
                                            <input type="tel" class="am-form-field am-text-center " ng-model="product.inputnumber" required
                                                   required
                                                   ng-required
                                                   ng-blur="ChangeText(product)"
                                                    >
                                            <span class="am-input-group-label am-radius " ng-click="AddBtn($index,product)">+</span>
                                        </div>
                                    </div>

                                </div>

                            </div>

                        </div>
                    </li>



                </ul>
            </div>

        </div>

        <!--加价购按钮和层-->

        <!---底部navbar-->
        <div data-am-widget="navbar" class="am-navbar am-cf am-navbar-default " id="navbar" >
            <div class="am-navbar-nav am-cf am-avg-sm-4" style="background: #EEEEEE !important;">
                <div class="am-g am-padding-0 am-margin-0">
                    <div class="am-u-sm-3 am-padding-0 am-margin-0">
                        <input type="checkbox" value="None"  name="checkboxAll" ng-model="checkAllStatus"  ng-click="CheckAllBtn()"/> 全选
                    </div>
                    <div class="am-u-sm-6 am-padding-0 ">
                        <div style="line-height: 15pt;" CLASS="am-padding-top-xs">
                            <p class="am-padding-0 am-margin-0 am-text-lg">总计:<span class="am-text-danger"><b>￥<span  ng-bind="TotalPrice"></span></b></span></p>
                            <p class="am-padding-0 am-margin-0 am-text-sm" style="color:#A3A3A3">(已经优惠<span  ng-bind="DiscountPrice"></span>元)</p>
                        </div>
                    </div>
                    <div class="am-u-sm-3">


                        <button type="button" class="am-btn am-btn-warning am-radius" ng-click="SubmitBtn()" ng-disabled="TotalPrice==0">结算</button>

                    </div>
                </div>
            </div>
        </div>
    </div>

    <!---加价购层-->
    <div id="pushpushDiv" style="display: none;">
        loading<br/>
        <button type="button" class="am-btn am-btn-default am-radius pushgoureturn">返回购物车</button>
    </div>
    <!---alert模态框-->
    <div class="am-modal am-modal-alert" tabindex="-1" id="my-alert">
        <div class="am-modal-dialog">
            <div class="am-modal-hd">提醒</div>
            <div class="am-modal-bd">
                {{Alertmsg}}
            </div>
            <div class="am-modal-footer">
                <span class="am-modal-btn">确定</span>
            </div>
        </div>
    </div>
    <!--loading 模态框-->
    <div class="am-modal am-modal-loading am-modal-no-btn" tabindex="-1" id="my-modal-loading">
        <span class="am-icon-spinner am-icon-spin"></span>
    </div>
    <!--删除确认模态框-->
    <div class="am-modal am-modal-confirm" tabindex="-1" id="my-confirm">
        <div class="am-modal-dialog">

            <div class="am-modal-bd">
                您，确定不买<span class="am-text-warning"><b>{{confirmname}}</b> </span>了吗？
            </div>
            <div class="am-modal-footer">
                <span class="am-modal-btn" data-am-modal-cancel>取消</span>
                <span class="am-modal-btn" data-am-modal-confirm>确定</span>
            </div>
        </div>
    </div>
    <!--NgC div end--->
</div>
<!--如果本页面有额外的js文件/代码需要加入到head中 使用如下代码-->
<% block('footer').append('<script src="'+CDN+'script/cart.js"></script>') %>
<% block('footer').append('<script src="'+CDN+'script/cartag.js"></script>') %>